from utils.dict_saver_loader import *
import os
from collections import Counter

dicts_dir = '../../hard_drive/entropy/bigram/'
file_names=os.listdir(dicts_dir)
merge_dict={}
for i in range(len(file_names)):
    ith_dict=load_dict(dicts_dir + file_names[i])
    c_merge_dict=Counter(merge_dict)
    c_ith_dict=Counter(ith_dict)
    merge_dict=dict(c_merge_dict + c_ith_dict)
save_dict(merge_dict,dicts_dir+'merge.txt')